package com.example.shoppingmall.service;

import com.example.shoppingmall.pojo.Classify;
import com.example.shoppingmall.dao.ClassifyMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ClassifyService {
    @Autowired
    private ClassifyMapper classifyMapper;

    public List<Classify> classifyList(){
        return classifyMapper.classifyList();
    }

    /**
     *
     * @param parentId
     * @return
     */
    public List<Classify>classifyListByParentId(@Param("parentId")int parentId){
        return classifyMapper.classifyListByParentId(parentId);
    }

    public List<Classify>getClassifyList(@Param("no")int no){

        return classifyMapper.getClassifyList(no);
    }

    public int count(){
        return classifyMapper.count();
    }

    public List<Classify>getClassifyByOne(){
        return classifyMapper.getClassifyByOne();
    }

    public int add(Classify classify){
        return classifyMapper.add(classify);
    }

    public int add1(Classify classify){
        return classifyMapper.add1(classify);
    }

    public int chackName(@Param("name")String name){
        return classifyMapper.chackName(name);
    }

    public int delete(@Param("id")int id){
        return classifyMapper.delete(id);
    }

    public int chackParentId(@Param("parentId")int parentId){
        return classifyMapper.chackParentId(parentId);
    }

    public Classify xiangQing(@Param("id")int id){
        return classifyMapper.xiangQing(id);
    }

    public int update1(Classify classify){
        return classifyMapper.update1(classify);
    }

    public int update2(Classify classify){
        return classifyMapper.update2(classify);
    }

    public int update3(Classify classify){
        return classifyMapper.update3(classify);
    }

    public int update4(Classify classify){
        return classifyMapper.update4(classify);
    }
}
